import { param } from './../../../utils/index';
import { dataQuery, dataVO, dataForm } from './type';
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
// 查询载荷算法管理列表
export const getAlgorithmList = (query: dataQuery): AxiosPromise<dataVO[]> => {
  return request({
    url: '/business/algorithmInfo/list',
    method: 'get',
    params: query
  });
};
//新增【算法信息】
export const addAlgorithm = (data) => {
  return request({
    url: '/business/algorithmInfo',
    method: 'post',
    data
  });
};
//修改【算法信息】
export const editAlgorithm = (data) => {
  return request({
    url: '/business/algorithmInfo',
    method: 'put',
    data
  });
};
//获取【算法信息】详情
export const getAlgorithmDetail = (id: string | number) => {
  return request({
    url: `/business/algorithmInfo/${id}`,
    method: 'get'
  });
};
// 下载程序
export const downloadAlgorithmInfo = (data) => {
  return request({
    url: '/business/algorithmInfo/downloadProgram',
    method: 'post',
    data,
    responseType: 'blob'
  });
};
